package cn.topevery.garden.entity.po;

import cn.topevery.garden.entity.serializer.GeometrySerializer;
import cn.topevery.garden.framework.base.BaseEntity;
import com.alibaba.fastjson.annotation.JSONField;
import hw.topevery.framework.annotation.DbTable;
import hw.topevery.framework.annotation.DbTableField;
import hw.topevery.framework.enums.DbTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.locationtech.jts.geom.Geometry;

import java.time.LocalDate;
import java.util.List;

/**
 * 行道树
 *
 * @author code-generate
 * @date 2022-01-05
 */
@Data
@DbTable(tableName = "t_gre_tree")
public class GreTree extends BaseEntity {
        /**
     * UUID
     */
    @DbTableField(columnName = "c_tree_id", dbType = DbTypeEnum.CHAR)
    public Character treeId ;

    /**
     * 编号
     */
    @DbTableField(columnName = "c_code", dbType = DbTypeEnum.VARCHAR)
    public String code ;

    /**
     * 中文名
     */
    @DbTableField(columnName = "c_name", dbType = DbTypeEnum.VARCHAR)
    public String name ;

    /**
     * 拉丁名
     */
    @DbTableField(columnName = "c_name_latin", dbType = DbTypeEnum.VARCHAR)
    public String nameLatin ;

    /**
     * 绿地Id
     */
    @DbTableField(columnName = "c_land_id", dbType = DbTypeEnum.INTEGER)
    public Integer landId ;

    /**
     * 树高（M）
     */
    @DbTableField(columnName = "c_tree_height", dbType = DbTypeEnum.DOUBLE)
    public Double treeHeight ;

    /**
     * 树宽（M） 范围
     */
    @DbTableField(columnName = "c_tree_width", dbType = DbTypeEnum.VARCHAR)
    public String treeWidth ;

    /**
     * 科名
     */
    @DbTableField(columnName = "c_tree_kind", dbType = DbTypeEnum.VARCHAR)
    public String treeKind ;

    /**
     * 属性
     */
    @DbTableField(columnName = "c_tree_attr", dbType = DbTypeEnum.VARCHAR)
    public String treeAttr ;

    /**
     * 类别ID
     */
    @DbTableField(columnName = "c_type", dbType = DbTypeEnum.VARCHAR)
    public String type ;

    /**
     * 类别
     */
    @DbTableField(columnName = "c_type_name", dbType = DbTypeEnum.VARCHAR)
    public String typeName ;

    /**
     * 所属地名
     */
    @DbTableField(columnName = "c_address", dbType = DbTypeEnum.VARCHAR)
    public String address ;

    /**
     * 所属路段
     */
    @DbTableField(columnName = "c_alone_load", dbType = DbTypeEnum.VARCHAR)
    public String aloneLoad ;

    /**
     * 街道Id
     */
    @DbTableField(columnName = "c_street_id", dbType = DbTypeEnum.VARCHAR)
    public String streetId ;

    /**
     * 街道名称
     */
    @DbTableField(columnName = "c_street_name", dbType = DbTypeEnum.VARCHAR)
    public String streetName ;

    /**
     * 区域ID
     */
    @DbTableField(columnName = "c_distract_id", dbType = DbTypeEnum.VARCHAR)
    public String distractId ;

    /**
     * 区域
     */
    @DbTableField(columnName = "c_distract_name", dbType = DbTypeEnum.VARCHAR)
    public String distractName ;

    /**
     * 社区Id
     */
    @DbTableField(columnName = "c_community_id", dbType = DbTypeEnum.VARCHAR)
    public String communityId ;

    /**
     * 社区名称
     */
    @DbTableField(columnName = "c_community_name", dbType = DbTypeEnum.VARCHAR)
    public String communityName ;

    /**
     * 普查图片地址
     */
    @DbTableField(columnName = "c_file_url", dbType = DbTypeEnum.VARCHAR)
    public String fileUrl ;

    /**
     * 备注
     */
    @DbTableField(columnName = "c_desc", dbType = DbTypeEnum.VARCHAR)
    public String desc ;

    /**
     * 普查日期
     */
    @DbTableField(columnName = "c_date", dbType = DbTypeEnum.DATE)
    public LocalDate date ;

    /**
     * 坐标X
     */
    @DbTableField(columnName = "c_lng", dbType = DbTypeEnum.DOUBLE)
    public Double lng ;

    /**
     * 坐标Y
     */
    @DbTableField(columnName = "c_lat", dbType = DbTypeEnum.DOUBLE)
    public Double lat ;

    /**
     * 胸径(m)
     */
    @DbTableField(columnName = "c_growth", dbType = DbTypeEnum.VARCHAR)
    public String growth ;

    /**
     * 审核状态
     */
    @DbTableField(columnName = "c_state", dbType = DbTypeEnum.BIT)
    public Boolean state ;

    /**
     * 生长状态
     */
    @DbTableField(columnName = "c_growth_state", dbType = DbTypeEnum.VARCHAR)
    public String growthState ;

    /**
     * 树木品种
     */
    @DbTableField(columnName = "c_tree_name", dbType = DbTypeEnum.VARCHAR)
    public String treeName ;

    /**
     * 平均冠幅
     */
    @DbTableField(columnName = "c_avg_crown", dbType = DbTypeEnum.DOUBLE)
    public Double avgCrown ;

    /**
     * 树池大小
     */
    @DbTableField(columnName = "c_spec", dbType = DbTypeEnum.VARCHAR)
    public String spec ;

    /**
     * 树龄
     */
    @DbTableField(columnName = "c_tree_old", dbType = DbTypeEnum.DOUBLE)
    public Double treeOld ;

    /**
     * 栽种单位
     */
    @DbTableField(columnName = "c_plant_units", dbType = DbTypeEnum.VARCHAR)
    public String plantUnits ;

    /**
     * 管理单位
     */
    @DbTableField(columnName = "c_manage", dbType = DbTypeEnum.VARCHAR)
    public String manage ;

    /**
     * 管理单位Id
     */
    @DbTableField(columnName = "c_manage_id", dbType = DbTypeEnum.VARCHAR)
    public String manageId ;

    /**
     * 图层名称
     */
    @DbTableField(columnName = "c_obj_name", dbType = DbTypeEnum.VARCHAR)
    public String objName ;

    @ApiModelProperty(value = "附件")
    private List<GreFile> fileList;

    /**
     * 范围
     */
    @DbTableField(columnName = "c_map_ranges", dbType = DbTypeEnum.OTHER)
    @JSONField(serializeUsing = GeometrySerializer.class, deserializeUsing = GeometrySerializer.class)
    public Geometry mapRanges ;

    /**
     * 计算空间数据
     */
    @DbTableField(columnName = "c_geo_wkt", dbType = DbTypeEnum.VARCHAR)
    public String geoWkt ;

    /**
     *树木类别 1 行道树，2林地, 3散树, 4散树面
     */
    @DbTableField(columnName = "c_tree_type_id", dbType = DbTypeEnum.INTEGER)
    public Integer treeTypeId ;

}
